<?php
/* @var $this UsuarioController */
/* @var $model Usuario */
/* @var $form CActiveForm */
?>


<script type="text/javascript">
$(document).ready(function(){
	$("#Usuario_Descuentos").keypress(function(event){
		var keynum = window.event ? window.event.keyCode : e.which;
    	if ((keynum == 8) || (keynum == 0))
    		return true;
   		return /\d/.test(String.fromCharCode(keynum));
   		});
});
</script>



<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'usuario-form',
	'enableAjaxValidation'=>false,
	'enableClientValidation'=>false,
	'clientOptions'=>array(
		'validateOnSubmit'=>true)
)); ?>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'Nick'); ?>
		<?php echo $form->textField($model,'Nick',array('size'=>10,'maxlength'=>10, 'autocomplete'=>'off')); ?>
		<?php echo $form->error($model,'Nick'); ?>
	</div>


	<div class="row">
		<?php echo $form->labelEx($model,'NOMBRE'); ?>
		<?php echo $form->textField($model,'NOMBRE',array('size'=>20,'maxlength'=>20, 'autocomplete'=>'off')); ?>
		<?php echo $form->error($model,'NOMBRE'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'APELLIDO'); ?>
		<?php echo $form->textField($model,'APELLIDO',array('size'=>30,'maxlength'=>30, 'autocomplete'=>'off')); ?>
		<?php echo $form->error($model,'APELLIDO'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'Contraseña'); ?>
		<?php echo $form->passwordField($model,'Contraseña',array('size'=>40,'maxlength'=>40)); ?>
		<?php echo $form->error($model,'Contraseña'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'Rol'); ?>
		<?php $datos = CHtml::listData(Rol::model()->findAll(),'Id','Rol');
			echo $form->DropDownList($model,'Rol',$datos, array('empty'=>'Seleccione una opción'));?>
		<?php echo $form->error($model,'Rol'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'Descuento'); ?>
		<?php echo $form->textField($model,'Descuentos', array('maxlength'=>3, 'autocomplete'=>'off')); ?>
		<?php echo $form->error($model,'Descuentos'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Guardar' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->